//
// CMiniCol.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CMiniCol {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CMiniCol(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CMiniCol obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CMiniCol(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CMiniCol() {
    this(nel3dJNI.new_CMiniCol(), true);
  }

  public void init(CLandscape land, float radMin, float radDelta) {
    nel3dJNI.CMiniCol_init__SWIG_0(swigCPtr, this, CLandscape.getCPtr(land), land, radMin, radDelta);
  }

  public void init(CLandscape land, float radMin) {
    nel3dJNI.CMiniCol_init__SWIG_1(swigCPtr, this, CLandscape.getCPtr(land), land, radMin);
  }

  public void init(CLandscape land) {
    nel3dJNI.CMiniCol_init__SWIG_2(swigCPtr, this, CLandscape.getCPtr(land), land);
  }

  public void addZone(long zoneId) {
    nel3dJNI.CMiniCol_addZone(swigCPtr, this, zoneId);
  }

  public void removeZone(long zoneId) {
    nel3dJNI.CMiniCol_removeZone(swigCPtr, this, zoneId);
  }

  public void setCenter(CVector center) {
    nel3dJNI.CMiniCol_setCenter(swigCPtr, this, CVector.getCPtr(center), center);
  }

  public boolean testMove(CVector prec, CVector cur) {
    return nel3dJNI.CMiniCol_testMove(swigCPtr, this, CVector.getCPtr(prec), prec, CVector.getCPtr(cur), cur);
  }

  public boolean snapToGround(CVector pos, float hup, float hbot) {
    return nel3dJNI.CMiniCol_snapToGround__SWIG_0(swigCPtr, this, CVector.getCPtr(pos), pos, hup, hbot);
  }

  public boolean snapToGround(CVector pos, float hup) {
    return nel3dJNI.CMiniCol_snapToGround__SWIG_1(swigCPtr, this, CVector.getCPtr(pos), pos, hup);
  }

  public boolean snapToGround(CVector pos) {
    return nel3dJNI.CMiniCol_snapToGround__SWIG_2(swigCPtr, this, CVector.getCPtr(pos), pos);
  }

  public boolean getGroundNormal(CVector pos, CVector normal, float hup, float hbot) {
    return nel3dJNI.CMiniCol_getGroundNormal__SWIG_0(swigCPtr, this, CVector.getCPtr(pos), pos, CVector.getCPtr(normal), normal, hup, hbot);
  }

  public boolean getGroundNormal(CVector pos, CVector normal, float hup) {
    return nel3dJNI.CMiniCol_getGroundNormal__SWIG_1(swigCPtr, this, CVector.getCPtr(pos), pos, CVector.getCPtr(normal), normal, hup);
  }

  public boolean getGroundNormal(CVector pos, CVector normal) {
    return nel3dJNI.CMiniCol_getGroundNormal__SWIG_2(swigCPtr, this, CVector.getCPtr(pos), pos, CVector.getCPtr(normal), normal);
  }

  public void getFaces(SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t triresult, SWIGTYPE_p_CAABBox bbox) {
    nel3dJNI.CMiniCol_getFaces(swigCPtr, this, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(triresult), SWIGTYPE_p_CAABBox.getCPtr(bbox));
  }

}
